-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use token from CSI TokenRequests #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Christopher Swenson <christopher.swenson@hashicorp.com>
Hey, wondering when/if this will make it to a release of the CSI driver. To my understanding these changes do not break any existing behaviours, they only allow using a new upstream feature. Are there any plans to get this merged? |
Sorry for the long delay on this PR. I've backed out the changelog notice that token generation will be deprecated, as I think that may still be useful longer term in some scenarios, but otherwise just merged in main. |
The Secrets Store CSI driver supports sending a token as part of the mount request as of 1.1.0 (relevant issue with rollout timeline), which is based on this feature from this KEP.
TL;DR is you use
--set tokenRequests[0].audience="vault"
when installing the CSI driver, and then it will populate a"csi.storage.k8s.io/serviceAccount.tokens"
field in the mount parameters which contains a token generated for the audience "vault". That way,vault-csi-provider
doesn't have to generate its own token for the requesting pod, and we can remove those Kubernetes permissions once we're ready to deprecate that way of doing things. However, I don't think we should deprecate immediately, as it still relies on Kubernetes 1.21+ and a pretty recent CSI driver version.A really nice feature is that it will cache the token per-pod, so each pod will get the same JWT on each mount request until it expires. This will make it much easier to add Vault Agent as a sidecar in a way that caching will work (i.e. issue #90).